import {
  BrowserRouter as Router,
  Routes,
  Route,
  Navigate,
} from "react-router-dom";
import Home from "./views/home/index";
import My from "./views/my/myIndex";
import Find from "./views/search/search";
import Destination from "./views/target/target";
import Demand from "./views/demand/commitDemand";
// import Footer from "./components/Footer";
// import Detail from './views/home/detail'
import Demo from "./views/demo/demo";
import "./assest/style/font/iconfont.css";
import "./assest/style/common.css";
import Login from "./views/login/login";
import Target from "./views/target/target";
import SelectDate from "./views/target/children/houseDetail/selectDate/selectDate";
import HouseDetail from "./views/target/children/houseDetail/houseDetail";
import HouseRes from "./views/target/children/houseRes/houseRes"
import OrderDetail from "./views/order/children/orderDetail/orderDetail";
import OrderSubmit from "./views/order/children/orderSubmit/orderSubmit";
import OrderList from "./views/order/children/orderList/orderList";
import OrderPay from "./views/order/children/orderPay/pay";
import Order from "./views/order/index";
import Collection from "./views/my/children/collection/collection";
import MyPanel from "./views/my/children/my/my";
import MyTrack from "./views/my/children/track/track";


function App() {
  return (
    <div className="app">
      <Router>
        <Routes>
          <Route path="/" element={<Navigate to="/home" />}></Route>
          <Route path="/home" element={<Home />}>
            {/* <Route path="detail" element={<Detail />} /> */}
          </Route>
          <Route path="/my" element={<My />}>
            {/* 收藏 */}
            <Route path="collection" element={<Collection />} />
            {/* 足迹 */}
            <Route path="track" element={<MyTrack />} />

            {/* 我的面板 */}
            <Route index element={<MyPanel />} />
          </Route>
          <Route path="/find" element={<Find />}></Route>
          {/* <Route path="/destination" element={<Destination />}>目的地</Route> */}
          {/* 需求 */}
          <Route path="/demand" element={<Demand />}></Route>

          {/* 目的地 */}
          <Route path="/target" element={<Target />}>
            {/* 选择日期 */}
            <Route path="selectDate" element={<SelectDate />} />
            {/* 房屋详情 */}
            <Route path="houseDetail" element={<HouseDetail />} />
            {/* 资源 */}
            <Route index element={<HouseRes />} />
          </Route>

          {/* 订单 */}
          <Route path="/order" element={<Order />}>
            <Route path="detail" element={<OrderDetail />} />
            <Route path="submit" element={<OrderSubmit />} />
            <Route path="pay" element={<OrderPay />} />
            <Route path="list" element={<OrderList />} />
            <Route index element={<OrderList />} />
          </Route>

          <Route path="/demo" element={<Demo />}></Route>
          {/* 登录 */}
          <Route path="/login" element={<Login />}></Route>
        </Routes>
        {/* <Footer /> */}
      </Router>
    </div>
  );
}

export default App;
